#ifndef _GAME_H
#define _GAME_H

#include <vector>
#include <string>
#include <iostream>
#include <Windows.h>

#include "Deck.h"
#include "Card.h"
#include "Player.h"
#include "Context.h"

struct Card;
class Deck;
class Player;
class Context;
class Game
{
public:
	Game(void);
	~Game(void);

/*Entry point for Game, calls pertinent functions and makes it hell of
a lot easier to keep track of the gameplay loop*/
	int Execute();

//Called by Execute to initialize pertinent data
#pragma region Game_Init
	bool Initialize();
#pragma endregion

//Called when game ends, clears all pertinent data and gives it back to Windows
#pragma region Game_Deinit
	void Deinitialize();
#pragma endregion

//Contains gameplay loop
#pragma region Game_Update
	void GameLoop();
	void CurrentTurn();
	void DetermineLeader();
	void CheckForEndgame();
#pragma endregion

//To allow players to interact with the game
#pragma region Game_Input
	int MainMenu();
	int Input();
	void PressKeyToContinue();
#pragma endregion
	
//Contains the pertinent functions for gameplay control
#pragma region Game_Supplement

	void PrintDeck(const Deck*);
	void PrintCard(const Card*);
	void PrintHand(Player*);
	void DealCard(Player*, int);
	int HandValue(std::vector<Card*>&);
#pragma endregion

//Pertinent variables to make the game go!
#pragma region Variables
	Deck* gameDeck;
	Context* context;
	Player* currentPlayer;
	Player* currentLeader;

	std::vector<Player*> playerList;
	int currentRound;

	static const int PlayerCount = 3;

private:
	bool Endgame;
	bool Running;
#pragma endregion
};

#endif // _GAME_H